
import request from '@/utils/request'
import qs from 'qs'

//礼包列表配置
export function bagsList(params){
    return request({
        url:'/api/bags',
        method:'get',
        params: qs.stringify(params)
    })
}
//礼包列表新增
export function bagsadd(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/bags',
        method:'post',
        data:qs.stringify(params)
    })
}

//礼包列表修改
export function bgasUpdate(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/bags/' + params.id ,
        method:'put',
        data:qs.stringify(params)
    })
}

//商品列表
export function itemList(params){
    return request({
        url:'/api/items',
        method:'get',
        params: qs.stringify(params)
    })
}

//商品列表新增
export function itemadd(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/items',
        method:'post',
        data:qs.stringify(params)
    })
}

//商品列表修改
export function itemUpdate(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/items/'+ params.id,
        method:'put',
        data:qs.stringify(params)
    })
}

//KA渠道列表
export function channelsList(params){
    return request({
        url:'/api/channels',
        method:'get',
        params: qs.stringify(params)
    })
}

//KA渠道新增
export function channelsAdd(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/channels',
        method:'post',
        data:qs.stringify(params)
    })
}

//KA渠道修改
export function channelsUpdate(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/channels/' + params.id,
        method:'put',
        data:qs.stringify(params)
    })
}


//渠道卡列表
export function cardList(params){
    return request({
        url:'/api/cards',
        method:'get',
        params: qs.stringify(params)
    })
}

//渠道卡新增
export function cardAdd(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/cards',
        method:'post',
        data:qs.stringify(params)
    })
}

//划拨渠道卡
export function channelUpdate(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/cards/channel',
        method:'put',
        data:qs.stringify(params)
    })
}

//联想渠道列表
export function lxChannelList(params){
    return request({
        url:'/api/lxChannels',
        method:'get',
        params: qs.stringify(params)
    })
}

//联想渠道新增
export function lxChannelAdd(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/lxChannels',
        method:'post',
        data:qs.stringify(params)
    })
}

//联想渠道导入
export function importData(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/importData',
        method:'post',
        data:qs.stringify(params)
    })
}

//联想导入模板
export function importTemplate(params){
    return request({
        url:'/api/importTemplate',
        method:'get',
    })
}


//订单列表
export function orderList(params){
    return request({
        url:'/api/orders',
        method:'get',
        params:qs.stringify(params)
    })
}

//订单导出
export function orderExport(params){
    return request({
        url:'/api/orders/export',
        method:'get',
        params:qs.stringify(params)
    })
}

//提现导出
export function withdrawsExport(params){
    return request({
        url:'/api/withdraws/export',
        method:'get',
        params:qs.stringify(params)
    })
}

//提现解锁
export function withdrawsStateUnlock(params){
    return request({
        url:'/api/withdraws/stateUnlock',
        method:'get',
        params:qs.stringify(params)
    })
}

//网体分红导出
export function fttprofitsExport(params){
    return request({
        url:'/api/fttprofits/export',
        method:'get',
        params:qs.stringify(params)
    })
}

//帐户导出
export function accountsExport(params){
    return request({
        url:'/api/accounts/export',
        method:'get',
        params:qs.stringify(params)
    })
}

//帐户流水导出
export function accountitemsExport(params){
    return request({
        url:'/api/accountitems/export',
        method:'get',
        params:qs.stringify(params)
    })
}

//用户导出
export function fttusersExport(params){
    return request({
        url:'/api/fttusers/export',
        method:'get',
        params:qs.stringify(params)
    })
}

//分红明细导出
export function fttuserprofitsExport(params){
    return request({
        url:'/api/fttuserprofits/export',
        method:'get',
        params:qs.stringify(params)
    })
}

//客户
export function userListAPI(params){
    return request({
        url:'/api/users',
        method:'get',
        params:qs.stringify(params)
    })
}

//物流
export function orderDelivery(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:`/api/orders/${params.id}/delivery`,
        method:'put',
        data:qs.stringify(params)
    })
}

//获取渠道卡统计
export function getChannelCardCount(){
    return request({
        url:'/api/cashRecords/getChannelCardCount',
        method:'get'
    })
}

//累计收益
export function getCashCount(){
    return request({
        url:'/api/cashRecords/getCashCount',
        method:'get'
    })
}

//申请提现
export function cashRecordsAdd(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/cashRecords/add',
        method:'post',
        data:qs.stringify(params)
    })
}

//提现列表
export function cashRecordsList(params){
    return request({
        url:'/api/cashRecords',
        method:'get',
        params:qs.stringify(params)
    })
}

//审核提现
export function verify(params){
    return request({
        url:'/api/cashRecords/verify',
        method:'post',
        data:params
    })
}

export function getCaseMoney(){
    return request({
        url:'/api/cashRecords/getCaseMoney',
        method:'get'
    })
}

//云南游
export function activityList(params){
    return request({
        url:'/api/activity220321s',
        method:'get',
        params: qs.stringify(params)
    })
}

//云南游状态
export function activityState(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:`/api/activity220321s/${params.id}/state`,
        method:'put',
        data:qs.stringify(params)
    })
}


//创合排名分红
export function PartnerShares(params){
    return request({
        url:'/api/PartnerShares',
        method:'get',
        params: qs.stringify(params)
    })
}

//创合排名人数
export function getRankNum(params){
    return request({
        url:'/api/PartnerShares/getRankNum',
        method:'get',
        params: qs.stringify(params)
    })
}

//创合入单名细
export function partnerOrderDetails(params){
    return request({
        url:'/api/partnerOrderDetails',
        method:'get',
        params: qs.stringify(params)
    })
}


//创合入单人数
export function getOrderNum(params){
    return request({
        url:'/api/partnerOrderDetails/getOrderNum',
        method:'get',
        params: qs.stringify(params)
    })
}

//新增创合
export function AddPartnerShares(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/partnerShares',
        method:'post',
        data:qs.stringify(params)
    })
}

//数据源
export function getShareOrders(params){
    return request({
        url:'/api/mtyhShareOrders',
        method:'get',
        params: qs.stringify(params)
    })
}

//添加数据源
export function postShareOrders(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/mtyhShareOrders',
        method:'post',
        data: qs.stringify(params)
    })
}

//补录订单
// export function getzjhbShareOrders(params){
//     return request({
//         url:'/api/zjhbShareOrders',
//         method:'get',
//         params: qs.stringify(params)
//     })
// }

//添加补录订单
export function postzjhbShareOrders(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/zjhbShareOrders',
        method:'post',
        data: qs.stringify(params)
    })
}
//关系链
export function getFttusers(params){
    return request({
        url:'/api/fttusers',
        method:'get',
        params: qs.stringify(params)
    })
}

//奖池总奖励
export function getfttprofits(params){
    return request({
        url:'/api/fttprofits',
        method:'get',
        params: qs.stringify(params)
    })
}

//账户管理
export function getAccounts(params){
    return request({
        url:'/api/accounts',
        method:'get',
        params: qs.stringify(params)
    })
}

//账户流水
export function getAccountitems(params){
    return request({
        url:'/api/accountitems',
        method:'get',
        params: qs.stringify(params)
    })
}

//用户列表
export function getFttusersList(params){
    return request({
        url:'/api/fttusers',
        method:'get',
        params: qs.stringify(params)
    })
}

//用户详情
export function getFttusersID(params){
    return request({
        url:'/api/fttusers/'+params.id,
        method:'get',
        params: qs.stringify(params)
    })
}

//增加用户
export function postFttusers(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/fttusers',
        method:'post',
        data: qs.stringify(params)
    })
}

//修改用户角色
export function putFttusersRolelevel(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:`/api/fttusers/${params.id}/rolelevel`,
        method:'put',
        data: qs.stringify(params)
    })
}

//修改用户网体等级
export function putfttlevel(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:`/api/fttusers/${params.id}/fttlevel`,
        method:'put',
        data: qs.stringify(params)
    })
}

//修改用户上级
export function putParents(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:`/api/fttusers/${params.id}/parents`,
        method:'put',
        data: qs.stringify(params)
    })
}

//修改用户绑定中军卡
export function putZjcard(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:`/api/fttusers/${params.id}/cardz`,
        method:'put',
        data: qs.stringify(params)
    })
}

//修改用户状态
export function putState(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:`/api/fttusers/${params.id}/state`,
        method:'put',
        data: qs.stringify(params)
    })
}

//修改用户手机号
export function putCellphone(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:`/api/fttusers/${params.id}/cellphone`,
        method:'put',
        data: qs.stringify(params)
    })
}

//删除用户
export function putUserDel(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:`/api/fttusers/${params.id}`,
        method:'delete',
        data: qs.stringify(params)
    })
}


//分红明细列表
export function getfttuserprofitsList(params){
    return request({
        url:'/api/fttuserprofits',
        method:'get',
        params: qs.stringify(params)
    })
}

//增加分红
export function postCashorder(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/fttprofits/cashorder',
        method:'post',
        data: qs.stringify(params)
    })
}


//提现审核列表
export function getWithdraws(params){
    return request({
        url:'/api/withdraws',
        method:'get',
        params: qs.stringify(params)
    })
}

//批量审批
export function putStateBatch(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:`/api/withdraws/stateBatch`,
        method:'put',
        data: qs.stringify(params)
    })
}

//已自提
export function putselfWithdrawal(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:`/api/orders/${params.id}/selfWithdrawal`,
        method:'put',
       
    })
}

//新增开卡号
export function postFttcard20220715s(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:'/api/fttcard20220715s/batch',
        method:'post',
        data: qs.stringify(params)
    })
}

//获取开卡号
export function getFttcard20220715s(params){
    return request({
        url:'/api/fttcard20220715s',
        method:'get',
        params: qs.stringify(params)
    })
}

//批量审批开卡号
export function putFttcard20220715s(params){
    return request({
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        url:`/api/fttcard20220715s/${params.id}/stateBatch`,
        method:'put',
        data: qs.stringify(params)
    })
}

//分红参数
export function fttProfitMoney(params){
    return request({
        url:'system/config/list?configKey=ftt.FttProfit.money',
        method:'get',
        params: qs.stringify(params)
    })
}
